import { RECOMMENDLIST } from './actionTypes'
import { get } from '@u/http.js'

const loadDataSync = recommend => {
    return {
        type:RECOMMENDLIST,
        recommend
    }
}

const loadDataAsync = () => {
    return async (dispatch) => {
        let result = await get({
            url:'/api/menu/list'
        })
        // console.log(result.data.menu);
        dispatch(loadDataSync(result.data.menu))
    }
}

export {
    loadDataSync,
    loadDataAsync
}